import java.util.Scanner;
import java.lang.System;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 邓大帅
 * Date: 2022-11-10
 * Time: 16:56
 */
public class IsPrime {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int j = input.nextInt();
        int flag = 0;
        if (j <= 1 ){
            flag = 1;
        }
        for (int i = 2; i <= (int)Math.sqrt(j) ; i++) {
            if (j % i == 0) {
                flag = 1;
            }
        }
        if (flag == 0) {
            System.out.println("YES");
        }
        else {
            System.out.println("NO");
        }
    }
}
